package com.ranjiaqi.collection.array;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @ClassName TestCollectionArray
 * @Description TODO
 * @Author hp
 * @Date 2021/6/25 9:49
 * @Version 1.0
 **/
public class TestCollectionArray {
    public static void main(String[] args) {
        collectionToArray();
    }
    public  static  void collectionToArray(){
        List<Integer>list = new ArrayList<Integer>();
        list.add(1);
        list.add(2);
        list.add(3);

        Integer[] integers = list.toArray(new Integer[list.size()]);
        System.out.println(Arrays.toString(integers));
    }
}
